package com.ruoyi.framework.security;

import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

/**
 * @Author: zhangQi
 * @Date: 2020-07-13 9:43
 * @D 权限用户密码租户Token校验
 */
public class UsernamePasswordTenantsAuthenticationToken extends UsernamePasswordAuthenticationToken implements TenantAuthentication{

    private Object tenantId;

    public UsernamePasswordTenantsAuthenticationToken(Object principal, Object credentials) {
        super(principal, credentials);
    }

    public UsernamePasswordTenantsAuthenticationToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) {
        super(principal, credentials, authorities);
    }

    public UsernamePasswordTenantsAuthenticationToken(Object tenantId,Object principal,Object credentials){
        super(principal, credentials);
        this.tenantId = tenantId;
    }

    @Override
    public Object getTenantId() {
        return tenantId;
    }
}
